//
//  HDRootVC.m
//  HDSmartPenSDKDemo
//
//  Created by 牛的mini on 2016/12/26.
//  Copyright © 2016年 牛的mini. All rights reserved.
//

#import "HDRootVC.h"

@interface HDRootVC ()

@end

@implementation HDRootVC

- (void)viewDidLoad {
    [super viewDidLoad];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(unopenBeaconTip) name:kBeacon_State_Unopen_Notification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(connectSuccess) name:kBeacon_Connect_Successful_Notification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pairSuccess) name:kBeacon_Pair_Successful_Notification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(disconnectSuccess) name:kBeacon_Disconnect_Successful_Notification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(languagePareError) name:kBeacon_Language_Parameter_Error_Notification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(LEDPareError) name:kBeacon_LED_Parameter_Error_Notification object:nil];
}

- (void)unopenBeaconTip
{ [LCCoolHUD showFailure:@"蓝牙未打开" zoom:NO shadow:NO]; }

- (void)connectSuccess
{
    [LCCoolHUD showSuccess:@"连接成功" zoom:YES shadow:YES];
    HDDeclare *declare = [HDDeclare sharedDeclare];
    declare.isConnected = YES;
}

- (void)pairSuccess
{ [LCCoolHUD showSuccess:@"配对成功" zoom:YES shadow:YES]; }

- (void)disconnectSuccess
{
    [LCCoolHUD showFailure:@"连接断开" zoom:YES shadow:YES];
    HDDeclare *declare = [HDDeclare sharedDeclare];
    declare.isConnected = NO;
}

- (void)languagePareError
{[LCCoolHUD showFailure:@"参数错误" zoom:NO shadow:NO]; }

- (void)LEDPareError
{ [LCCoolHUD showFailure:@"参数错误" zoom:NO shadow:NO]; }

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    self.navigationController.navigationBarHidden = YES;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
